<?php
//接口不能直接实例化
interface Person{
    public function eat();
   
    public function sleep();
}

class Man implements Person{
        public function eat()
        {
            echo "吃海鲜";
        }
        public function sleep()
        {
            echo "早起早睡";
        }
}
class L{
    public function factory(Person $user)
    {
        return $user;
    }
}
$user = L::factory(new Man());

$user->eat();
$user->sleep();
